/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.customer.core.repository.entity;

import com.gitee.peigenlpy.actable.annotation.Column;
import com.gitee.peigenlpy.actable.annotation.Index;
import com.gitee.peigenlpy.actable.annotation.Table;
import com.gitee.peigenlpy.actable.annotation.Unique;
import com.gitee.peigenlpy.actable.constants.MySqlCharsetConstant;
import com.gitee.peigenlpy.actable.constants.MySqlEngineConstant;
import com.gitee.peigenlpy.actable.constants.MySqlTypeConstant;
import info.peigen.hotpot.business.customer.facade.enums.operator.CustomerOperatorRole;
import info.peigen.hotpot.business.customer.facade.enums.operator.CustomerOperatorStatus;
import info.peigen.hotpot.component.data.repository.beetlsql.entity.AbstractCreateTimeEntity;
import lombok.*;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import java.util.Date;

/**
 * <b>(CustomerOperatorEntity)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/2
 */
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
@Table(name = "customer_operator", comment = "客户操作员表", charset = MySqlCharsetConstant.UTF8MB4, engine = MySqlEngineConstant.InnoDB)
@org.beetl.sql.annotation.entity.Table(name = "customer_operator")
public class CustomerOperatorEntity extends AbstractCreateTimeEntity {
    @Column(name = "operator_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false,
            comment = "操作员Id;默认只有一个Master操作员的时候,该Id与customerId一样")
    @Unique(value = "operatorId", columns = "operator_id")
    @org.beetl.sql.annotation.entity.Column("operator_id")
    String                 operatorId;
    @Column(name = "customer_id", type = MySqlTypeConstant.VARCHAR, length = 30, isNull = false, comment = "客户Id")
    @Index(value = "customerId", columns = "customer_id")
    @org.beetl.sql.annotation.entity.Column("customer_id")
    String                 customerId;
    @Column(name = "login_name", type = MySqlTypeConstant.VARCHAR, length = 200, comment = "登录名;可用是手机号/邮箱")
    @Unique(value = "loginName", columns = "login_name")
    @org.beetl.sql.annotation.entity.Column("login_name")
    String                 loginName;
    @Column(name = "login_password", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "登录密码")
    @org.beetl.sql.annotation.entity.Column("login_password")
    String                 loginPassword;
    @Column(name = "pay_password", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "交易密码")
    @org.beetl.sql.annotation.entity.Column("pay_password")
    String                 payPassword;
    @Column(name = "salt", type = MySqlTypeConstant.VARCHAR, length = 20, comment = "密码盐")
    @org.beetl.sql.annotation.entity.Column("salt")
    String                 salt;
    @Column(name = "status", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false, comment = "状态;Init:初始化,Enable:可用,Unable:不可用")
    @Index(value = "status", columns = "status")
    @org.beetl.sql.annotation.entity.Column("status")
    CustomerOperatorStatus status;
    @Column(name = "operator_role", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false,
            comment = "操作员角色;Master:主操作员,Financial:财务,CustomerService:客服")
    @org.beetl.sql.annotation.entity.Column("operator_role")
    CustomerOperatorRole   customerOperatorRole;
    @Column(name = "delete_flag", type = MySqlTypeConstant.VARCHAR, length = 20, isNull = false, comment = "删除标记;Y/N")
    @Index(value = "deleteFlag", columns = "delete_flag")
    @org.beetl.sql.annotation.entity.Column("delete_flag")
    String                 deleteFlag;
    @Column(name = "mobile", type = MySqlTypeConstant.VARCHAR, length = 20, comment = "操作员手机号")
    @org.beetl.sql.annotation.entity.Column("mobile")
    String                 mobile;
    @Column(name = "email", type = MySqlTypeConstant.VARCHAR, length = 100, comment = "操作员邮箱")
    @org.beetl.sql.annotation.entity.Column("email")
    String                 email;
    @Column(name = "login_last_fail_time", type = MySqlTypeConstant.TIMESTAMP, comment = "最后登录失败时间")
    @org.beetl.sql.annotation.entity.Column("login_last_fail_time")
    Date                   loginLastFailTime;
    @Column(name = "login_password_error_times", type = MySqlTypeConstant.INT, comment = "登录密码错误次数")
    @org.beetl.sql.annotation.entity.Column("login_password_error_times")
    Integer                loginPasswordErrorTimes;
    @Column(name = "login_password_valid_time", type = MySqlTypeConstant.TIMESTAMP, comment = "登录密码失效时间")
    @org.beetl.sql.annotation.entity.Column("login_password_valid_time")
    Date                   loginPasswordValidTime;
    @Column(name = "login_password_last_modify_time", type = MySqlTypeConstant.TIMESTAMP, comment = "最后一次登录密码修改时间")
    @org.beetl.sql.annotation.entity.Column("login_password_last_modify_time")
    Date                   loginPasswordLastModifyTime;
    @Column(name = "pay_last_fail_time", type = MySqlTypeConstant.TIMESTAMP, comment = "最后支付失败时间")
    @org.beetl.sql.annotation.entity.Column("pay_last_fail_time")
    Date                   payLastFailTime;
    @Column(name = "pay_password_error_times", type = MySqlTypeConstant.INT, comment = "交易密码错误次数")
    @org.beetl.sql.annotation.entity.Column("pay_password_error_times")
    Integer                payPasswordErrorTimes;
    @Column(name = "pay_password_valid_time", type = MySqlTypeConstant.TIMESTAMP, comment = "交易密码失效时间")
    @org.beetl.sql.annotation.entity.Column("pay_password_valid_time")
    Date                   payPasswordValidTime;
    @Column(name = "pay_password_last_modify_time", type = MySqlTypeConstant.TIMESTAMP, comment = "最后一次支付密码修改时间")
    @org.beetl.sql.annotation.entity.Column("pay_password_last_modify_time")
    Date                   payPasswordLastModifyTime;
    @Column(name = "last_login_time", type = MySqlTypeConstant.TIMESTAMP, comment = "最后一次登录时间")
    @org.beetl.sql.annotation.entity.Column("last_login_time")
    Date                   lastLoginTime;
    @Column(name = "last_login_ip", type = MySqlTypeConstant.VARCHAR, length = 20, comment = "最后登录IP")
    @org.beetl.sql.annotation.entity.Column("last_login_ip")
    String                 lastLoginIp;
    @Column(name = "memo", type = MySqlTypeConstant.VARCHAR, length = 2000, comment = "memo")
    @org.beetl.sql.annotation.entity.Column("memo")
    String                 memo;
}